import 'package:json_annotation/json_annotation.dart';

part 'order_checkout_req.g.dart';

@JsonSerializable()
class OrderCheckoutReq {
  final int addressId;
  final Map<int, int> storeCarts;
  final String payType;
  final String paySource;
  final Map<String, String> coinPayPasswords;
  final List<int> userPortMappingIds;
  final String openid;
  final Map<int, String> orderMemos;
  final Map<int, List<int>> storeCoupons;
  final Map<int, List<int>> storeCredits;

  OrderCheckoutReq({
    this.addressId,
    this.storeCarts,
    this.payType,
    this.paySource = 'APP',
    this.coinPayPasswords,
    this.userPortMappingIds,
    this.openid,
    this.orderMemos,
    this.storeCoupons,
    this.storeCredits,
  });

  factory OrderCheckoutReq.fromJson(Map<String, dynamic> json) => _$OrderCheckoutReqFromJson(json);

  Map<String, dynamic> toJson() => _$OrderCheckoutReqToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
